package org.scau.studentevaluation.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.scau.studentevaluation.config.global.log.WebLog;
import org.scau.studentevaluation.entity.query.GetOtherActQuery;
import org.scau.studentevaluation.entity.query.OtherActQuery;
import org.scau.studentevaluation.entity.query.UpdateOtherActQuery;
import org.scau.studentevaluation.entity.query.UploadOtherActQuery;
import org.scau.studentevaluation.entity.vo.OtherActVO;
import org.scau.studentevaluation.service.IOtherActService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@Api("OtherAct控制器")
@WebLog("OtherAct控制器")
public class OtherActController {

    @Autowired
    private IOtherActService otherActService;

    @ApiOperation("通过学院获取其他活动")
    @GetMapping("/getOtherActsByCollege/{college}")
    public List<OtherActVO> getOtherActsByCollege(String college){
        return otherActService.getOtherActsByCollege(college);
    }

    @ApiOperation("获取其他活动2")
    @GetMapping("/getOtherActs")
    public List<OtherActVO> getOtherActs(GetOtherActQuery getOtherActQuery){
        return otherActService.getOtherActs(getOtherActQuery);
    }

    @ApiOperation("修改其他活动")
    @GetMapping("/updateOtherAct")
    public int updateOtherAct(UpdateOtherActQuery updateOtherActQuery){
        return otherActService.updateOtherActs(updateOtherActQuery);
    }

    @ApiOperation("获取学生的其他活动Id")
    @GetMapping("/getOtherActId")
    public List<Long> getOtherActId(Long studentId){
        return otherActService.getOtherActId(studentId);
    }

    @ApiOperation("上传其他活动")
    @PostMapping("/uploadOtherAct")
    @WebLog
    public int uploadOtherAct(UploadOtherActQuery uploadOtherActQuery){
        return otherActService.uploadOtherAct(uploadOtherActQuery);
    }
}
